﻿
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="StudentList.aspx.cs" Inherits="SchoolAdministration.StudentList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pagetitle" runat="server">
    <h3 class="page-title">View Student Details</h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="breadcrum" runat="server">
     <ul class="breadcrumb">
        <li><a href="#">School Administrator</a><span class="divider">/</span></li>
        <li><a href="#">Student Manangement</a><span class="divider">/</span></li>
        <li class="active">View Student Details</li>                      
    </ul>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="mainchangingpart" runat="server">
    <div id="filter">
Filter By:
        <asp:DropDownList ID="ddlClass" runat="server" AutoPostBack="true" AppendDataBoundItems="false" OnSelectedIndexChanged="ddlClass_SelectedIndexChanged"></asp:DropDownList>
        <asp:DropDownList ID="ddlsection" runat="server" AutoPostBack="true" AppendDataBoundItems="false" OnSelectedIndexChanged="ddlsection_SelectedIndexChanged" ></asp:DropDownList>
       Search By name <asp:TextBox ID="txtSearch" runat="server" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged" CausesValidation="false" ></asp:TextBox>
    </div>

<div class="widget yellow">
      <div class="widget-title">
           <h4>View Students</h4>
      </div>
      <div class="widget-body">
          <asp:GridView
               ID="GridViewStd"
               AutoGenerateColumns="False"
               CssClass="table table-bordered"
               OnSelectedIndexChanged="GridViewStd_SelectedIndexChanged"
               OnRowDataBound="GridViewStd_RowDataBound"
               OnRowCommand="GridViewStd_RowCommand"
               OnRowDeleted="GridViewStd_RowDeleted"
               OnRowDeleting="GridViewStd_RowDeleting"
               runat="server">
              <Columns>
                <asp:BoundField DataField="Studentid" HeaderText="Id" SortExpression="Studentid" />
                <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
                <asp:BoundField DataField="MiddleName" HeaderText="Middle Name" SortExpression="MiddleName" />
                <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
                  <asp:BoundField DataField="Roll" HeaderText="Roll" SortExpression="Roll" />
                  <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                  
                  <asp:BoundField DataField="Grade" HeaderText="Grade" SortExpression="Grade" />
                <asp:TemplateField HeaderText="Edit">
                <ItemTemplate>
                <asp:HyperLink  runat="server" ID="BtnEdit" Text="Edit" NavigateUrl='<%# "EditStudent.aspx?StudentId=" + Eval("Studentid") + "&Student=" + Eval("FirstName") %>' />
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                 <asp:LinkButton  ID="DeleteButton" CommandArgument='<%# Eval("Studentid") %>' CommandName="Delete" runat="server">
                  Delete</asp:LinkButton>
                  </ItemTemplate>
                 </asp:TemplateField>
                  <asp:TemplateField HeaderText="Detail">
                <ItemTemplate>
                <asp:HyperLink  runat="server" ID="BtnDetails" Text="Detail" NavigateUrl='<%# "DetailStudent.aspx?StudentId=" + Eval("Studentid") + "&Student=" + Eval("FirstName") %>' />
                </ItemTemplate>
                </asp:TemplateField>

                                </Columns>

          </asp:GridView>
      </div>
</div>
</asp:Content>
